//
//  JXBHelper.m
//  MobileBank
//
//  Created by jiaxing Bank on 2022/1/7.
//

#import "JXBHelper.h"
#import "MBProgressHUD.h"

@implementation JXBHelper


+ (void)showLoadingWithView:(UIView *)aView{
    MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:aView animated:YES];
    hud.labelText = @"加载中…";
    //hud.color = [UIColor redColor];
    hud.labelFont = [UIFont systemFontOfSize:14.0f];
}

+ (void)hiddonLoadingWithView:(UIView *)aView{
    [MBProgressHUD hideAllHUDsForView:aView animated:YES];
}

//显示提示框
+ (void)showMessageWithHud:(NSString*)message
                     addTo:(UIViewController*)controller
                   yOffset:(CGFloat)yoffset
{
    MBProgressHUD* hud = nil;
    if (controller.view) {
        hud = [MBProgressHUD showHUDAddedTo:controller.view animated:YES];
    }
    hud.yOffset = yoffset;//默认传0,想显示在屏幕的位置自己调试
    hud.mode = MBProgressHUDModeText;
    hud.detailsLabelText = message;
    hud.margin = 10.f;
    hud.removeFromSuperViewOnHide = YES;
    [hud hide:YES afterDelay:1];
}

@end
